<%@ tag language="java" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ attribute name="value" type="java.lang.Object" required="true" rtexprvalue="true" %>
<c:set var="hospitalRef" value="${value}" />
<c:url var="HOSPITAL_CAPTION_URL" value="/ws/hospital/loadHospitalCaptionPage.html?hospitalId=${hospitalRef.hospital.id}" />
<script type="text/javascript">
<!--
$(document).ready(function() {
    var container = $('#rating-container-${hospitalRef.hospital.id}');
    container.block({message: '<p>読み込み中...</p>', overlayCSS: {backgroundColor: '#fff'}});
    container.load('${HOSPITAL_CAPTION_URL}', null, function() {});
    container.unblock();
});
//-->
</script>
<div class="result">
  <div class="rtitle">
    <h1>
      <span class="company"><c:out value="${hospitalRef.hospital.companyName}" /></span>
      <a href="<c:url value='/hospitals/${hospitalRef.hospital.id}.html' />"><c:out value="${hospitalRef.hospital.name}" /></a>
    </h1>
  </div>
  <img alt="Image" src="<c:url value='/images/photos/no-image.png' />" class="rimage" />
  <div class="rcontainer">
    <div id="rating-container-${hospitalRef.hospital.id}"></div>
    <div class="description">
      <div class="title">住所</div>
      <div class="info">
        <c:if test="${not empty hospitalRef.hospital.zipCode1}"><span>〒</span><c:out value="${hospitalRef.hospital.zipCode1}" />-<c:out value="${hospitalRef.hospital.zipCode2}" /><br/></c:if>
        <c:out value="${hospitalRef.hospital.state}" /><c:out value="${hospitalRef.hospital.city}" /><c:out value="${hospitalRef.hospital.address1}" />
        <c:out value="${hospitalRef.hospital.address2}" />&nbsp;
      </div>
    </div>
    <div class="description">
      <div class="title">アクセス</div>
      <div class="info"><c:forEach var="access" items="${hospitalRef.accesses}"><c:out value="${access.way}" />&nbsp;<c:out value="${access.stationName}" />&nbsp;&nbsp;</c:forEach>&nbsp;</div>
    </div>
    <div class="description">
      <div class="title">診療科</div>
      <div class="info"><c:forEach var="division" items="${hospitalRef.divisions}"><c:out value="${division.name}" />&nbsp;&nbsp;</c:forEach>&nbsp;</div>
    </div>
  </div>
</div>
